<% extends 'sale/weui_base.html' %>
<% block title %>销售订单<% endblock %>
<% block body %>
<script>
    var sale_row = ${order|safe};
</script>
<div id="sale_order">
    <el-alert v-if="sale_form.error" :title="sale_form.error_message" type="error" :closable="false"> </el-alert>
    <el-form ref="sale_form" :model="sale_form" label-width="80px" size="mini" v-if="!sale_form.error">
        <el-form-item label='操作信息 ' size="mini">
            <a :href="'/wx/stock/tally/'+sale_form.order_id + '?from=sale'" >
             <el-button type="primary"  v-if="['cancel', 'draft', 'done'].indexOf(sale_form.state)< 0" link="">
                  查看出库单
             </el-button></a>
        </el-form-item>
          <el-form-item label="主要信息" size="mini" inline>
              <el-tag>销售订单号： {{sale_form.name}}</el-tag>
              <el-tag>客户：{{sale_form.partner_name}}</el-tag>

          </el-form-item>
         <el-form-item label="其他信息" size="mini" inline>
            <el-tag type="info">付款方式:{{sale_form.payment_method}}</el-tag>
            <el-tag type="info">期望送货时间:{{sale_form.expected_delivery_time}}</el-tag>
              <el-tag>总金额：{{sale_form.amount_total}}</el-tag>
         </el-form-item>
         <el-form-item label="状态信息" size="mini" inline>
            <el-tag type="info">采购已审核:<i v-if="sale_form.purchase_managed" class="el-icon-success"></i>
                <i  class="el-icon-error" v-else></i> </el-tag>
            <el-tag type="info">已送货完成:<i v-if="sale_form.shipment_completion" class="el-icon-success"></i>
                <i  class="el-icon-error" v-else></i> </el-tag>
            <el-tag type="info">已打印:<i v-if="sale_form.print_state" class="el-icon-success"></i>
                <i  class="el-icon-error" v-else></i></el-tag>
            <el-tag type="info">卡券订单:<i v-if="sale_form.is_card" class="el-icon-success"></i>
                <i  class="el-icon-error" v-else></i></el-tag>
         </el-form-item>
        <el-table :data="sale_form.order_line"  border  stripe>
            <el-table-column type="expand">
                <template slot-scope="props">
                    <el-form label-position="left" inline class="demo-table-expand">
                        <el-form-item label="价格: ">
                            <span>{{ props.row.price_unit}}</span>
                        </el-form-item>
                        <el-form-item label="商品编码: ">
                            <span>{{ props.row.product_code }}</span>
                        </el-form-item>
                        <el-form-item label="小记: ">
                            <span>{{ props.row.price_subtotal}}</span>
                        </el-form-item>
                    </el-form>
                </template>
            </el-table-column>
            <el-table-column
                    label="产品名称"
                    prop="product_name">
            </el-table-column>
            <el-table-column
                    label="数量"
                    width="50"
                    prop="product_uom_qty">
            </el-table-column>
        </el-table>
        <el-form-item label="主要备注" v-if="sale_form.note" size="mini">
            <el-input v-model="sale_form.note" :disabled="true" type="textarea"></el-input>
        </el-form-item>
        <el-form-item label="内部备注" v-if="sale_form.inner_note" size="mini">
            <el-input v-model="sale_form.inner_note" :disabled="true" type="textarea"></el-input>
        </el-form-item>
        <el-form-item label="仓库备注" v-if="sale_form.stock_note" size="mini">
            <el-input v-model="sale_form.stock_note" :disabled="true" type="textarea"></el-input>
        </el-form-item>
    </el-form>
</div>

<script src="/dftg_weixin/static/src/js/sale/order.js?v0.06"></script>
<% endblock %>
